﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BSCMFF.Core.BusinessLayer
{
    public class BSCTreeListItem
    {
        public string ID { get; set; }
        public int OrigID { get; set; }
        public string Name { get; set; }
        //private enum ItemType {KPI, Perspective, BSC};
        public string ItemType { get; set; }
        public string Weight { get; set; }
        public string ParentID { get; set; }
        public string Persp { get; set; }
        public string Progress { get; set; }
        public string Performance { get; set; }

        public string Current { get; set; }
        public string Start { get; set; }
        public string Target { get; set; }
        public string Min { get; set; }
        public string Max { get; set; }

        public BSCTreeListItem(){}

        public BSCTreeListItem(int id, string name, string itemType, int? weight, int parentID)
        {
            switch (itemType)
            {
                case "KPI": ID = id.ToString();
                            OrigID = id;
                            Name = name;
                            Persp = "";
                            ParentID = "perspective" + parentID.ToString();
                            Weight = weight == null ? "" : weight.ToString();
                            break;
                case "Perspective": ID = "perspective" + id.ToString();
                            OrigID = id;
                            Name = name;
                            Persp = "";
                            ParentID = "0";
                            Weight = weight == null ? "" : weight.ToString();
                            break;
                default:    ID = "0"; //BSC
                            Name = "Balance Scorecard";
                            Persp = "";
                            ParentID = "";
                            Weight = "";
                            break;
            }
            //ID = id.ToString();
            //Name = name;
            //Persp = "";
            //ParentID = ""; // parentID.ToString();


        }
        //public BSCTreeListItem(int id, string name, string perspective, int weight)
        //{
        //    if (parentID == 0) //perspective
        //    {
        //        ID = "perspective" + id.ToString();
        //        Name = name;
        //        Persp = perspective;
        //        ParentID = parentID.ToString();
        //    }
        //    else //kpi
        //    {
        //        ID = id.ToString();
        //        Name = name;
        //        //Quantity = quantity;
        //        //Price = price;
        //        //InStock = inStock;
        //        Persp = perspective;
        //        ParentID = "perspective" + parentID.ToString();
        //    }
        //}

        
    }
      
}
